package com.qcby.demoforspringboot.controller;

import com.qcby.demoforspringboot.entity.User;
import com.qcby.demoforspringboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("login")
public class LoginController {
    @Autowired
    private UserService userService;
    @RequestMapping()
    public List<User> login(String username, String password){
        System.out.println(username);
        System.out.println(password);
        List<User> list = userService.list();
        list.forEach(System.out::println);
        return list;
    }
}
